<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<style>
    .box {
        color: red;
    }
</style>
<body>
<div id="root" @click="changeColor" :class="{box: inbox}">
    Hello World!
</div>
<script>
    var vm = new Vue({
        el: '#root',
        data: {
            inbox: false
        },
        methods: {
            changeColor: function () {
                this.inbox=!this.inbox;
            }
        }
    })
</script>
</body>
</html>